﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

/// <summary>
/// 单例组件类
/// </summary>
public  class SingletonCompoent : ECSCompoentBase
{
    private static SingletonCompoent m_SingletonCom;
    private static object goLock=new object();
    public static SingletonCompoent IsingletonCompoent
    {
        get {
            lock (goLock)
            {
                if (m_SingletonCom==null)
                {
                    m_SingletonCom=new SingletonCompoent();
                    return m_SingletonCom;
                }

                return m_SingletonCom;
            }
        }
        set {
            if (value is SingletonCompoent)
            {
                m_SingletonCom = value;
            }
            else
            {
                Debug.LogError("类型不匹配");
            }
        }
    }
    public override void Init()
    {
        throw new NotImplementedException();
    }

    public override int ToHash()
    {
        return -1;
    }
}

